package com.sang.web;

import com.sang.fegin.UserFeignApi;
import com.sang.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("feign")
public class FeignController {

    @Autowired
    UserFeignApi userFeignApi;
    //实现基于客户端的负载均衡
    //
    @GetMapping("{id}")
    public User queryById(@PathVariable("id") String id){
        System.out.println("进入consumer的feign");
        return userFeignApi.queryById(id);
    }
}
